package app.bedcheck;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import app.thread.HdSetting;
import base.JsonResult;

/**
 * 控制类
 * @author zoe
 *
 */
@Controller
@RequestMapping("/bedcheck/")
public class StatisticsController {
	
	private Logger logger = Logger.getLogger(StatisticsController.class);
	
	@Autowired
	private StatisticsService statisticsService;
	
	/**
	 * 获取人员在位情况
	 * @param type
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/getPersonState.do")
	public JsonResult getPersonState(String type){
		return new JsonResult(statisticsService.getPersonState(type));
	}
	
	/**
	 * 获取人员压力数据
	 * @param type
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/getPersonData.do")
	public JsonResult getPersonData(String type){
		return new JsonResult(statisticsService.getPersonData(type));
	}
	
	/**
	 * 设置系统参数
	 * @param hdSetting
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/saveSetting.do")
	public JsonResult saveSetting(HdSetting hdSetting){
		return new JsonResult(statisticsService.saveSetting(hdSetting));
	}
}
